<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.0.2">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="fonts.useso.com/css?family=Lato:300,300italic,400,400italic,700,700italic|Roboto+Slab:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">
<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  
  <link rel="stylesheet" href="/lib/animate-css/animate.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.css">
  <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/pace-js@1/themes/blue/pace-theme-minimal.min.css">
  <script src="//cdn.jsdelivr.net/npm/pace-js@1/pace.min.js"></script>

<script class="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"changlujava.gitee.io","root":"/","scheme":"Gemini","version":"8.0.0-rc.5","exturl":true,"sidebar":{"position":"left","width":240,"display":"post","padding":18,"offset":12},"copycode":false,"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":true,"mediumzoom":false,"lazyload":true,"pangu":true,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"path":"search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}};
  </script>

  <meta name="description" content="参考资料学习视频：尚硅谷Linux基础教程(大数据、JavaEE、Python开发通用版)   原理图我们接下来通过XFtp来将对应安装包从windows传入到Linux中，看一下原理图">
<meta property="og:type" content="article">
<meta property="og:title" content="05、JavaEE定制篇">
<meta property="og:url" content="https://changlujava.gitee.io/child/2020/12/02/05%E3%80%81JavaEE%E5%AE%9A%E5%88%B6%E7%AF%87/index.html">
<meta property="og:site_name" content="Changlu&#39;s Blog">
<meta property="og:description" content="参考资料学习视频：尚硅谷Linux基础教程(大数据、JavaEE、Python开发通用版)   原理图我们接下来通过XFtp来将对应安装包从windows传入到Linux中，看一下原理图">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130152204.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130152522.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130153400.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130154122.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130154441.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130160116.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130161124.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130161852.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130162251.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130162524.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130163020.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130163608.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130163803.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130164120.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130164453.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130164629.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130205849.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130212412.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130212517.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130213929.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130231633.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130233825.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130234428.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130234801.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130235835.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201000825.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201001011.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201001601.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201001821.png">
<meta property="og:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201002344.png">
<meta property="article:published_time" content="2020-12-02T12:55:24.000Z">
<meta property="article:modified_time" content="2020-12-02T12:55:24.000Z">
<meta property="article:author" content="changlu">
<meta property="article:tag" content="Linux部署web环境">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130152204.png">

<link rel="canonical" href="https://changlujava.gitee.io/child/2020/12/02/05%E3%80%81JavaEE%E5%AE%9A%E5%88%B6%E7%AF%87/">


<script class="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>05、JavaEE定制篇 | Changlu's Blog</title>
  


  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?8d799723b49054783f9671bcbc95d020";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style>
  body { margin-top: 2rem; }

  .use-motion .menu-item,
  .use-motion .sidebar,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header {
    visibility: visible;
  }

  .use-motion .header,
  .use-motion .site-brand-container .toggle,
  .use-motion .footer { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle,
  .use-motion .custom-logo-image {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line {
    transform: scaleX(1);
  }

  .search-pop-overlay, .sidebar-nav { display: none; }
  .sidebar-panel { display: block; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="Changlu's Blog" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <!-- fork me on github右上角设置 -->
    <a target="_blank" rel="noopener" href="https://github.com/changlua/changlua.github.io" class="github-corner" aria-label="View source on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" style="fill:#70B7FD; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>

    <main class="main">
      <header class="header" itemscope itemtype="http://schema.org/WPHeader">
        <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <h1 class="site-title">Changlu's Blog</h1>
      <i class="logo-line"></i>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">12</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">7</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">12</span></a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <section class="post-toc-wrap sidebar-panel">
          <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99"><span class="nav-text">参考资料</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%8E%9F%E7%90%86%E5%9B%BE"><span class="nav-text">原理图</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#1%E3%80%81%E5%AE%89%E8%A3%85JDK"><span class="nav-text">1、安装JDK</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%AF%A6%E7%BB%86%E6%AD%A5%E9%AA%A4"><span class="nav-text">详细步骤</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A0-%E8%A7%A3%E5%8E%8BJDK%E5%8E%8B%E7%BC%A9%E5%8C%85"><span class="nav-text">① 解压JDK压缩包</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A1-%E8%BF%9B%E5%85%A5bin%E7%9B%AE%E5%BD%95%E6%B5%8B%E8%AF%95"><span class="nav-text">② 进入bin目录测试</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A2-%E8%AE%BE%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-text">③ 设置环境变量</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#2%E3%80%81%E5%AE%89%E8%A3%85Tomcat"><span class="nav-text">2、安装Tomcat</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%AF%A6%E7%BB%86%E6%AD%A5%E9%AA%A4-1"><span class="nav-text">详细步骤</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A0-%E8%A7%A3%E5%8E%8Btomcat%E5%8E%8B%E7%BC%A9%E5%8C%85"><span class="nav-text">① 解压tomcat压缩包</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A1-%E5%90%AF%E5%8A%A8tomcat%E6%9C%8D%E5%8A%A1"><span class="nav-text">② 启动tomcat服务</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A2-linux%E8%AE%BF%E9%97%AEtomcat"><span class="nav-text">③ linux访问tomcat</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A3-%E5%BC%80%E6%94%BE%E7%AB%AF%E5%8F%A38080%EF%BC%8Cwin%E8%AE%BF%E9%97%AE%E5%87%86%E5%A4%87"><span class="nav-text">④ 开放端口8080，win访问准备</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A4-windows%E8%AE%BF%E9%97%AEtomcat"><span class="nav-text">⑤ windows访问tomcat</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#3%E3%80%81%E5%AE%89%E8%A3%85eclipse"><span class="nav-text">3、安装eclipse</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%AF%A6%E7%BB%86%E6%AD%A5%E9%AA%A4-2"><span class="nav-text">详细步骤</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A0-%E8%A7%A3%E5%8E%8Beclipse%E5%8E%8B%E7%BC%A9%E5%8C%85"><span class="nav-text">① 解压eclipse压缩包</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A1-%E5%9C%A8%E6%A1%8C%E9%9D%A2%E6%B7%BB%E5%8A%A0eclipse%E7%9A%84%E8%BD%AF%E9%93%BE%E6%8E%A5"><span class="nav-text">② 在桌面添加eclipse的软链接</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A2-%E6%B5%8B%E8%AF%95eclipse%E8%BF%90%E8%A1%8Cweb%E9%A1%B9%E7%9B%AE"><span class="nav-text">③ 测试eclipse运行web项目</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Linux%E4%B8%8A%E8%AE%BF%E9%97%AEweb%E9%A1%B9%E7%9B%AE"><span class="nav-text">Linux上访问web项目</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#windows%E4%B8%8A%E8%AE%BF%E9%97%AEweb%E9%A1%B9%E7%9B%AE"><span class="nav-text">windows上访问web项目</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#4%E3%80%81%E5%AE%89%E8%A3%85mysql"><span class="nav-text">4、安装mysql</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%AF%A6%E7%BB%86%E6%AD%A5%E9%AA%A4-3"><span class="nav-text">详细步骤</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A0-%E5%8D%B8%E8%BD%BD%E5%8E%9F%E6%9D%A5%E5%AE%89%E8%A3%85%E7%9A%84mysql"><span class="nav-text">① 卸载原来安装的mysql</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A1-%E5%AE%89%E8%A3%85%E7%BC%96%E8%AF%91%E4%BB%A3%E7%A0%81%EF%BC%8C%E8%A7%A3%E5%8E%8B%E5%8E%8B%E7%BC%A9%E5%8C%85"><span class="nav-text">② 安装编译代码，解压压缩包</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A2-%E7%BC%96%E8%AF%91%E5%B9%B6%E5%AE%89%E8%A3%85%E6%BA%90%E7%A0%81"><span class="nav-text">③ 编译并安装源码</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A3-%E9%85%8D%E7%BD%AE%E7%94%A8%E4%BA%8E%E4%B8%8E%E7%BB%84"><span class="nav-text">④ 配置用于与组</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A4-%E5%88%9D%E5%A7%8B%E5%8C%96%E9%85%8D%E7%BD%AEmysql"><span class="nav-text">⑤ 初始化配置mysql</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%91%A5-%E5%90%AF%E5%8A%A8mysql"><span class="nav-text">⑥ 启动mysql</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%AE%BE%E7%BD%AE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F"><span class="nav-text">设置环境变量</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%BA%94%E7%94%A8%E6%A1%88%E4%BE%8B"><span class="nav-text">应用案例</span></a></li></ol></li></ol></li></ol></div>
      </section>
      <!--/noindex-->

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-author animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <a href="/about">
    <img class="site-author-image" itemprop="image" alt="changlu"
      src="/images/avator_image.jpg">
  <p class="site-author-name" itemprop="name">changlu</p>
  <div class="site-description" itemprop="description">欢迎来到长路的个人博客！</div>
</div>
<div class="site-state-wrap animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">12</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author animated">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9naXRodWIuY29tL2NoYW5nbHVh" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;changlua"><i class="fab fa-github fa-fw"></i>GitHub</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cDovL3dwYS5xcS5jb20vbXNncmQ/dj0zJnVpbj05Mzk5NzQ4ODMmc2l0ZT1xcSZtZW51PXllcw==" title="QQ → http:&#x2F;&#x2F;wpa.qq.com&#x2F;msgrd?v&#x3D;3&amp;uin&#x3D;939974883&amp;site&#x3D;qq&amp;menu&#x3D;yes"><i class="fab fa-qq fa-fw"></i>QQ</span>
      </span>
      <span class="links-of-author-item">
        <a href="/atom.xml" title="RSS → &#x2F;atom.xml"><i class="fas fa-rss fa-fw fa-fw"></i>RSS</a>
      </span>
  </div>


  <div class="links-of-blogroll animated">
    <div class="links-of-blogroll-title"><i class="fa fa-globe fa-fw"></i>
      友情链接
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2NsOTM5OTc0ODgz" title="https:&#x2F;&#x2F;blog.csdn.net&#x2F;cl939974883">CSDN</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly93d3cueXVxdWUuY29tL2NoYW5nbHUteHM1cGc=" title="https:&#x2F;&#x2F;www.yuque.com&#x2F;changlu-xs5pg">语雀</span>
        </li>
        <li class="links-of-blogroll-item">
          <span class="exturl" data-url="aHR0cHM6Ly9naXRlZS5jb20vY2hhbmdsdUphdmE=" title="https:&#x2F;&#x2F;gitee.com&#x2F;changluJava">Gitee</span>
        </li>
    </ul>
  </div>

      </section>

      <!--网易云插件-->
      <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 
        src="////music.163.com/outchain/player?type=2&id=757911&auto=1&height=66">
      </iframe>
        <div class="back-to-top animated">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </header>

      
  <div class="reading-progress-bar"></div>

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL2NoYW5nbHVhL2NoYW5nbHVhLmdpdGh1Yi5pbw==" title="Follow me on GitHub" aria-label="Follow me on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>

<noscript>
  <div id="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


      <div class="main-inner">
        

        <div class="content post posts-expand">
          

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://changlujava.gitee.io/child/2020/12/02/05%E3%80%81JavaEE%E5%AE%9A%E5%88%B6%E7%AF%87/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avator_image.jpg">
      <meta itemprop="name" content="changlu">
      <meta itemprop="description" content="欢迎来到长路的个人博客！">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Changlu's Blog">
    </span>

    
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          05、JavaEE定制篇
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-12-02 20:55:24" itemprop="dateCreated datePublished" datetime="2020-12-02T20:55:24+08:00">2020-12-02</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/Linux/" itemprop="url" rel="index"><span itemprop="name">Linux</span></a>
                </span>
            </span>

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="far fa-comment"></i>
      </span>
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/2020/12/02/05%E3%80%81JavaEE%E5%AE%9A%E5%88%B6%E7%AF%87/#valine-comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2020/12/02/05%E3%80%81JavaEE%E5%AE%9A%E5%88%B6%E7%AF%87/" itemprop="commentCount"></span>
    </a>
  </span>
  
  <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>4.2k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>4 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <h1 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h1><p>学习视频：<span class="exturl" data-url="aHR0cHM6Ly93d3cuYmlsaWJpbGkuY29tL3ZpZGVvL0JWMTFXNDExVDdqUj9wPTI=">尚硅谷Linux基础教程(大数据、JavaEE、Python开发通用版)<i class="fa fa-external-link-alt"></i></span>  </p>
<h1 id="原理图"><a href="#原理图" class="headerlink" title="原理图"></a>原理图</h1><p>我们接下来通过XFtp来将对应安装包从windows传入到Linux中，看一下原理图</p>
<a id="more"></a>

<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130152204.png"></p>
<blockquote>
<p>传输安装包</p>
</blockquote>
<p>我们将jdk、eclipse、tomcat以及mysql来传入到/opt的目录下，等待一会即可传输完成！</p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130152522.png">  </p>
<hr>
<h1 id="1、安装JDK"><a href="#1、安装JDK" class="headerlink" title="1、安装JDK"></a>1、安装JDK</h1><p><strong>大致步骤</strong>：① 解压JDK  ② 设置环境变量</p>
<h2 id="详细步骤"><a href="#详细步骤" class="headerlink" title="详细步骤"></a>详细步骤</h2><h3 id="①-解压JDK压缩包"><a href="#①-解压JDK压缩包" class="headerlink" title="① 解压JDK压缩包"></a>① 解压JDK压缩包</h3><p>我们进入到/opt目录下，对JDK进行解压  <code>tar -zxvf jdk-7u79-linux-x64.gz</code></p>
<hr>
<h3 id="②-进入bin目录测试"><a href="#②-进入bin目录测试" class="headerlink" title="② 进入bin目录测试"></a>② 进入bin目录测试</h3><p>我们进入到/home/jdk1.7.0_79/bin目录中，输入命令 <code>./java</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130153400.png">  </p>
<hr>
<h3 id="③-设置环境变量"><a href="#③-设置环境变量" class="headerlink" title="③ 设置环境变量"></a>③ 设置环境变量</h3><p>刚刚只是到目录中执行命令，接下来我们到**/etc/profile**中进行配置jdk环境变量   <code>vim /etc/profile</code></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">JAVA_HOME=/opt/jdk1.7.0_79</span><br><span class="line">PATH=/opt/jdk1.7.0_79/bin:$PATH</span><br><span class="line">export JAVA_HOME PATH</span><br></pre></td></tr></table></figure>

<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130154122.png">  </p>
<p>④ 注意配置完之后，在第3运行级别的使用<code>logout</code>即可测试，第5级别的需要注销下进行测试</p>
<p><strong>点击退出—注销测试即可</strong></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130154441.png">  </p>
<p><strong>总结</strong>：软件放置在/opt目录中，主要操作就是解压，之后配置环境变量，环境变量编辑/etc/profile文件即可，配置好之后要注销或者重启再进行测试</p>
<hr>
<h1 id="2、安装Tomcat"><a href="#2、安装Tomcat" class="headerlink" title="2、安装Tomcat"></a>2、安装Tomcat</h1><blockquote>
<p>之前已经将安装包放置到/opt目录下了</p>
</blockquote>
<p><strong>主要步骤如下</strong>：① 解压压缩包   ②启动tomcat   ③ linux下访问tomcat   ④ 开启8080端口，windows来访问</p>
<h2 id="详细步骤-1"><a href="#详细步骤-1" class="headerlink" title="详细步骤"></a>详细步骤</h2><h3 id="①-解压tomcat压缩包"><a href="#①-解压tomcat压缩包" class="headerlink" title="① 解压tomcat压缩包"></a>① 解压tomcat压缩包</h3><p>打开/opt目录，解压tomcat的安装包   <code>tar -zxvf apache-tomcat-7.0.70.tar.gz</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130160116.png">  </p>
<h3 id="②-启动tomcat服务"><a href="#②-启动tomcat服务" class="headerlink" title="② 启动tomcat服务"></a>② 启动tomcat服务</h3><p>我们先到达对应tomcat的bin目录 执行<code>cd /opt/apache-tomcat-7.0.70/bin</code></p>
<p>接着我们执行startup.sh脚本来进行启动  <code>./startup.sh</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130161124.png">  </p>
<p><strong>问题描述</strong>：执行启动脚本报错了</p>
<p>我们需要进入到<strong>setclasspath.sh</strong>中  <code>vim setclasspath.sh</code>   并编辑添加两个环境变量：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">export JAVA_HOME=/opt/jdk1.7.0_79</span><br><span class="line">export JRE_HOME=/opt/jdk1.7.0_79/jre</span><br></pre></td></tr></table></figure>

<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130161852.png">  </p>
<p><strong>注意</strong>：根据你自己的jdk位置来进行编辑，此时我们问题已经解决</p>
<p>接下来我们来运行tomcat，依旧是在tomcat的bin目录中执行 <code>./startup.sh</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130162251.png"></p>
<p><strong>注意</strong>：之后停止tomcat的话到指定目录执行命令 <code>./shutdown.sh</code></p>
<hr>
<h3 id="③-linux访问tomcat"><a href="#③-linux访问tomcat" class="headerlink" title="③ linux访问tomcat"></a>③ linux访问tomcat</h3><p>访问 <span class="exturl" data-url="aHR0cDovLzE5Mi4xNjguMTgxLjEyODo4MDgwLw==">http://192.168.181.128:8080/<i class="fa fa-external-link-alt"></i></span> ，出现下面界面访问成功！</p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130162524.png">  </p>
<hr>
<h3 id="④-开放端口8080，win访问准备"><a href="#④-开放端口8080，win访问准备" class="headerlink" title="④ 开放端口8080，win访问准备"></a>④ 开放端口8080，win访问准备</h3><blockquote>
<p>介绍：只要开放端口8080，才能被外网访问。</p>
</blockquote>
<p>我们首先查看一下防火墙的状态：<code>service iptables status</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130163020.png"></p>
<p> 我们也可以在windows的cmd中输入命令：<code>telnet ip地址 端口号</code>，进行测试连接<img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130163608.png">  </p>
<p>很显然我们虚拟机中linux的8080端口未外开放，我们的防火墙并没有对8080端口进行放行：</p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130163803.png"></p>
<p><strong>如何设置防火墙的端口号放行呢</strong>？我们只需要在/etc/sysconfig/iptables这个配置文件中配置端口即可</p>
<p>编辑文档：<code>vim /etc/sysconfig/iptables</code>   添加下面一行内容即可，<strong>保存退出</strong></p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT</span><br></pre></td></tr></table></figure>

<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130164120.png">  </p>
<p>接着我们重启防火墙服务：<code>service iptables restart</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130164453.png"></p>
<hr>
<h3 id="⑤-windows访问tomcat"><a href="#⑤-windows访问tomcat" class="headerlink" title="⑤ windows访问tomcat"></a>⑤ windows访问tomcat</h3><p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130164629.png"></p>
<p>成功访问！！！ </p>
<hr>
<h1 id="3、安装eclipse"><a href="#3、安装eclipse" class="headerlink" title="3、安装eclipse"></a>3、安装eclipse</h1><h2 id="详细步骤-2"><a href="#详细步骤-2" class="headerlink" title="详细步骤"></a>详细步骤</h2><h3 id="①-解压eclipse压缩包"><a href="#①-解压eclipse压缩包" class="headerlink" title="① 解压eclipse压缩包"></a>① 解压eclipse压缩包</h3><p>在我们之前压缩包的目录/opt中进行解压  <code>tar -zxvf eclipse-jee-mars-2-linux-gtk-x86_64.tar.gz</code></p>
<hr>
<h3 id="②-在桌面添加eclipse的软链接"><a href="#②-在桌面添加eclipse的软链接" class="headerlink" title="② 在桌面添加eclipse的软链接"></a>② 在桌面添加eclipse的软链接</h3><p> 我们安装的eclipse的exe为/opt/eclipse/eclipse，此时我们要在桌面上设置一个软链接来打开eclipse</p>
<p>我们可以使用命令  <code>ln -s /opt/eclipse/eclipse eclipse</code>，如下图：</p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130205849.png">  </p>
<hr>
<h3 id="③-测试eclipse运行web项目"><a href="#③-测试eclipse运行web项目" class="headerlink" title="③ 测试eclipse运行web项目"></a>③ 测试eclipse运行web项目</h3><p>我们在/root/桌面目录中使用命令打开eclipse  <code>./eclipse</code></p>
<p>具体创建过程见语雀：  <span class="exturl" data-url="aHR0cHM6Ly93d3cueXVxdWUuY29tL2NoYW5nbHUteHM1cGcvZ2gxNTRxL2txbm1rdg==">创建web工程<i class="fa fa-external-link-alt"></i></span></p>
<hr>
<h3 id="Linux上访问web项目"><a href="#Linux上访问web项目" class="headerlink" title="Linux上访问web项目"></a>Linux上访问web项目</h3><p>我们使用火狐来访问一下：访问成功！</p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130212412.png">  </p>
<hr>
<h3 id="windows上访问web项目"><a href="#windows上访问web项目" class="headerlink" title="windows上访问web项目"></a>windows上访问web项目</h3><p>访问网址：<span class="exturl" data-url="aHR0cDovLzE5Mi4xNjguMTgxLjEyODo4MDgwL2RlbW8vSGVsbG8uanNw">http://192.168.181.128:8080/demo/Hello.jsp<i class="fa fa-external-link-alt"></i></span></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130212517.png">  </p>
<p>成功！！！</p>
<hr>
<h1 id="4、安装mysql"><a href="#4、安装mysql" class="headerlink" title="4、安装mysql"></a>4、安装mysql</h1><h2 id="详细步骤-3"><a href="#详细步骤-3" class="headerlink" title="详细步骤"></a>详细步骤</h2><h3 id="①-卸载原来安装的mysql"><a href="#①-卸载原来安装的mysql" class="headerlink" title="① 卸载原来安装的mysql"></a>① 卸载原来安装的mysql</h3><p>首先我们查看linux中是否有mysql，使用命令 <code>rpm -qa | grep mysql</code>  查看</p>
<p>我们删除它，若是使用<code>rpm -e mysql-libs </code>无法删除，那么使用命令 <code>rpm -e --nodeps mysql-libs</code>强制删除即可</p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130213929.png">  </p>
<hr>
<h3 id="②-安装编译代码，解压压缩包"><a href="#②-安装编译代码，解压压缩包" class="headerlink" title="② 安装编译代码，解压压缩包"></a>② 安装编译代码，解压压缩包</h3><p><code>yum list | grep mysql </code>    我们可以使用这个命令来查看一下yum源上的mysql</p>
<p>**安装编译代码需要包(在安装前，需先安装相关的依赖库)**：<code>yum -y install make gcc-c++ cmake bison-devel  ncurses-devel</code></p>
<p>接着我们到/opt目录中解压mysql：<code>tar -zxvf mysql-5.6.14.tar.gz</code></p>
<hr>
<h3 id="③-编译并安装源码"><a href="#③-编译并安装源码" class="headerlink" title="③ 编译并安装源码"></a>③ 编译并安装源码</h3><p>我们进入到安装mysql的目录里：<code>cd /opt/mysql-5.6.14</code></p>
<p>我们使用下面命令来进行编译：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_MEMORY_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DMYSQL_TCP_PORT=3306 -DENABLED_LOCAL_INFILE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci</span><br></pre></td></tr></table></figure>

<p>等待一会即可</p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130231633.png">  </p>
<p>接下来才是真正的编译，进行编译安装：<code>make &amp;&amp; make install</code></p>
<p><strong>这个过程需要等待的比较久，大概15-20分钟</strong>！</p>
<hr>
<h3 id="④-配置用于与组"><a href="#④-配置用于与组" class="headerlink" title="④ 配置用于与组"></a>④ 配置用于与组</h3><p>我们通过两条命令来查看是否有mysql用户及用户组：<code>cat /etc/passwd | grep mysql</code>    <code>cat /etc/group | grep mysql</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130233825.png">  </p>
<p>确定没有对应用户及用户组，我们来手动<strong>创建用户</strong>并<strong>指定用户组</strong>：<code>groupadd mysql</code></p>
<p><code>useradd -g mysql mysql</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130234428.png">  </p>
<p>在前面安装完mysql时，在/usr/local目录下已经有了mysql文件，我们为<strong>其文件及其目录下所有子文件设置用户与组，就是刚刚创建的用户及组</strong>：<code>chown -R mysql:mysql /usr/local/mysql</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130234801.png">  </p>
<hr>
<h3 id="⑤-初始化配置mysql"><a href="#⑤-初始化配置mysql" class="headerlink" title="⑤ 初始化配置mysql"></a>⑤ 初始化配置mysql</h3><blockquote>
<p>初始化配置是执行初始化配置脚本，创建系统自带的数据库和表</p>
</blockquote>
<p>首先进入到/usr/local/mysql目录，<code>cd /usr/local/mysql</code></p>
<p>接下来执行下面的指令来初始化mysql：</p>
<figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql</span><br></pre></td></tr></table></figure>



<p>初始化之后，我们来查看一下/etc/目录下是否有my.cnf： <code>cd /etc</code>   <code>ls | grep my.cnf</code></p>
<p><strong>为什么要查看是否有这个文件呢</strong>？是因为在接下来启动MySQL服务时，会按照一定次序来搜索my.cnf，会先在/etc目录下找，找不到在搜索”$basedir/my.cnf”，而我们本次安装在centos6.8上的mysql的my.cnf是在/usr/local/mysql目录下，为了防止读取到不是同一个文件，如果在/etc目录下有的话我们更改它的名字，使用命令为：<code>mv /etc/my.cnf /etc/my.cnf.bak</code>。</p>
<p><strong>通过命令我们能够看到当前目录没有对应的配置文件，那么我们就不作修改了</strong>：</p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201130235835.png">  </p>
<hr>
<h3 id="⑥-启动mysql"><a href="#⑥-启动mysql" class="headerlink" title="⑥ 启动mysql"></a>⑥ 启动mysql</h3><p>首先我们需要添加服务，拷贝服务脚本到init.d目录，并设置开机启动  </p>
<p>【重要】我们先到达指定目录 <code>cd /usr/local/mysql</code></p>
<p>【重要】接着拷贝服务脚本 <code>cp support-files/mysql.server /etc/init.d/mysql</code></p>
<p>【重要】设置所有级别情况下都开启mysql  <code>chkconfig mysql on</code></p>
<p>开启之后，我们注销一下查看是否开启了mysql：<code>chkconfig --list | grep mysql</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201000825.png">  </p>
<p>由于本次是第一次，所以我们需要手动开启mysql服务：<code>service mysql start</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201001011.png">  </p>
<p><strong>启动成功！！！</strong></p>
<hr>
<h3 id="设置环境变量"><a href="#设置环境变量" class="headerlink" title="设置环境变量"></a>设置环境变量</h3><p>我们在/etc/profile这个环境变量配置文件中添加环境变量：<code>vim /etc/profile</code></p>
<p>我们在PATH后添加一条路径：<code>/usr/local/mysql/bin</code>  ，保存退出</p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201001601.png">  </p>
<p>我们可以注销退出或者刷新该配置文件：<code>source /etc/profile</code></p>
<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201001821.png">  </p>
<p><strong>我们在别的路径下测试一下，成功！</strong></p>
<hr>
<h3 id="应用案例"><a href="#应用案例" class="headerlink" title="应用案例"></a>应用案例</h3><p><strong>案例描述：我们mysql命令行中创建数据库、表，并插入数据，最后查看</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">create database coderCL;</span><br><span class="line">use coderCL;</span><br><span class="line"></span><br><span class="line">create table linuxtest(id int,name varchar(32));</span><br><span class="line"></span><br><span class="line">insert into linuxtest values(15,&quot;长路&quot;);</span><br><span class="line">insert into linuxtest values(18,&quot;林儿&quot;);</span><br><span class="line"></span><br><span class="line">select * from linuxtest;</span><br></pre></td></tr></table></figure>

<p><img data-src="https://gitee.com/changluJava/picture-bed/raw/master/mouse/20201201002344.png">  </p>
<p>最终我们输入<code>exit</code>来退出mysql交互状态！！！</p>
<hr>
<p>​                                                            <strong>整理者：长路  时间：2020/11/30</strong></p>

    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>changlu
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://changlujava.gitee.io/child/2020/12/02/05%E3%80%81JavaEE%E5%AE%9A%E5%88%B6%E7%AF%87/" title="05、JavaEE定制篇">https://changlujava.gitee.io/child/2020/12/02/05、JavaEE定制篇/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzQuMC8="><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</span> 许可协议。转载请注明出处！
  </li>
</ul>
</div>

        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/images/wechat.jpg">
            <span class="icon">
              <i class="fab fa-weixin"></i>
            </span>

            <span class="label">WeChat</span>
          </a>
        </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Linux%E9%83%A8%E7%BD%B2web%E7%8E%AF%E5%A2%83/" rel="tag"><i class="fa fa-tag"></i> Linux部署web环境</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/12/02/04%E3%80%81Linux%E9%AB%98%E7%BA%A7%E9%83%A8%E5%88%86/" rel="prev" title="04、Linux高级部分">
      <i class="fa fa-chevron-left"></i> 04、Linux高级部分
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/12/06/HTML5/" rel="next" title="html">
      html <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



        </div>
        
    <div class="comments" id="valine-comments"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">changlu</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    <span title="站点总字数">108k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">1:38</span>
</div>
  <!--
  <div class="powered-by">由 <span class="exturl theme-link" data-url="aHR0cHM6Ly9oZXhvLmlv">Hexo</span> & <span class="exturl theme-link" data-url="aHR0cHM6Ly90aGVtZS1uZXh0LmpzLm9yZw==">NexT.Gemini</span> 强力驱动
  </div>
  <br/>
  -->
  <div class="powered-by">
    <i class="fa fa-user-md"></i>
    <span id="busuanzi_container_site_uv">
      本站访客数<span id="busuanzi_value_site_uv"></span>人次
    </span>
  </div>


        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/@fancyapps/fancybox@3/dist/jquery.fancybox.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/lozad@1/dist/lozad.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/pangu@4/dist/browser/pangu.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/next-boot.js"></script>


  
  <script>
    (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      bp.src = (curProtocol === 'https') ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js';
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>




  
<script src="/js/local-search.js"></script>













  

  

  
  <script src="//cdn.jsdelivr.net/npm/quicklink@2/dist/quicklink.umd.js"></script>
  <script>
      window.addEventListener('load', () => {
      quicklink.listen({
        timeout : 3000,
        priority: true,
        ignores : [uri => uri.includes('#'),uri => uri === 'https://changlujava.gitee.io/child/2020/12/02/05%E3%80%81JavaEE%E5%AE%9A%E5%88%B6%E7%AF%87/',]
      });
      });
  </script>


<script>
NexT.utils.loadComments('#valine-comments', () => {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js', () => {
    new Valine(Object.assign({
      el  : '#valine-comments',
      path: location.pathname,
    }, {"enable":true,"appId":"RKq07e1mB9ImJNBK1sNX36Qm-gzGzoHsz","appKey":"p9Q0YXonqjlX0h4L2syIP0Tu","placeholder":"ヾﾉ≧∀≦)o快来，快来！","avatar":"mm","meta":["nick","mail","link"],"pageSize":10,"language":null,"visitor":false,"comment_count":true,"recordIP":false,"serverURLs":null,"enableQQ":false,"requiredFields":[]}
    ));
  }, window.Valine);
});
</script>

  <!-- 添加背景特效 -->
  
    <script type="text/javascript" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>
  
  <!-- 添加点击特效 -->
  
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginModelPath":"assets/","model":{"jsonPath":"/live2dw/assets/shizuku.model.json"},"display":{"position":"right","width":150,"height":300},"mobile":{"show":true},"rect":"opacity:0.7","log":false,"pluginJsPath":"lib/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
